package com.changeover.gwt.shared.datasource.impl;

import java.util.List;

import com.changeover.gwt.shared.datasource.ICustomerDataSource;
import com.changeover.gwt.shared.model.customer.ComplexCustomer;
import com.changeover.gwt.shared.model.customer.ICustomer;
import com.changeover.gwt.shared.model.customer.LastAction;
import com.google.common.collect.ImmutableList;
import com.google.gwt.i18n.client.DateTimeFormat;

public class ComplexCustomerDataSource implements ICustomerDataSource {

    private final List<LastAction> lastActions = ImmutableList.of(new LastAction(1, "correspondence started"),
                                                                  new LastAction(2, "not responding"));

    private final List<ICustomer> customers = ImmutableList.<ICustomer> of(new ComplexCustomer(9123, "Apple AF", "A",
                                                                                               new LastAction(1, "correspondence started"), null),
                                                                           new ComplexCustomer(9125, "Dagoberk Duck",
                                                                                               "A", new LastAction(2, "not responding"),
                                                                                               DateTimeFormat.getFormat("dd/MM/yyyy").parse("23/05/2012")),
                                                                           new ComplexCustomer(8932, "Microsoft", "A",
                                                                                               new LastAction(1, "correspondence started"), null),
                                                                           new ComplexCustomer(9999, "Trapper Joch MD",
                                                                                               "A", new LastAction(1, "correspondence started"), null));
    
    @Override
    public List<ICustomer> getCustomers() {
        return customers;
    }

    @Override
    public List<LastAction> getLastActions() {
        return lastActions;
    }
}
